import json
def main(arg1: str) -> dict:
    try:
        data = json.loads(arg1)
        # 获取参数
        class_name = data["class"]
        confidence = data["confidence"]
        # 阈值
        flag = 0.8
        if confidence >= flag:
            result = f"分类结果：{class_name} , 匹配度：{confidence}"
        else:
            result = f"未识别, {class_name}的匹配度 {confidence} 小于{flag}"
    except json.JSONDecodeError:
        result = "错误：输入参数不是有效的JSON格式"
    except KeyError as e:
        result = f"错误：缺少必要参数 {e}"
    except Exception as e:
        result = f"错误：{str(e)}"
    return {
        "result": result,
    }
